﻿using UnityEngine;

namespace Common
{
    /// <summary>
    /// Singleton class
    /// </summary>
    /// <typeparam name="T">Type of the singleton</typeparam>
    public abstract class Singleton<T>  where T : Singleton<T>, new()
    {
        private static T m_Instance;

        /// <summary>
        /// The static reference to the instance
        /// </summary>
        public static T Instance => m_Instance ?? (m_Instance = new T());
    }

}